<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>ifree</title>


    <script src="/static/js/jquery-3.2.1.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">

    <link rel="stylesheet" href="/static/css/swiper-3.4.2.min.css">
    <script src="/static/js/swiper-3.4.2.min.js"></script>

    <style>
        #header_navbar{
            background:#6495ED;
        }
        #header_navbar a{
            color: white;
        }

        #header_navbar a:hover{
            color: #EEE0E5;
        }

        .navbar-default .navbar-nav>.active>a{
            background: royalblue;
        }

    </style>

</head>
<body>

<div class="container">
    <nav id="header_navbar" class="navbar navbar-default">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a id="home" class="navbar-brand" href="#">ifree</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li><a href="#">weibo</a></li>
                    <li><a href="#">项目</a></li>
                    <li><a id="words" href="#">私信</a></li>
                    <li><a href="#">关于我</a></li>
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>

    <iframe id="homepage" src="/index/index/getHomepage" width="100%" frameborder="0" height="auto" scrolling="no"></iframe>

    <!--<iframe id="message" src="/index/message/" width="100%" frameborder="0" scrolling="no"></iframe>-->

</div>


<script>
    function setIframeHeight(iframe) {
        if (iframe) {
            var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
            if (iframeWin.document.body) {
                iframe.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
            }
        }
    };
    window.onload = function () {

        var homepage = document.getElementById('homepage');
        var message = document.getElementById('words');
        var home = document.getElementById('home');
        setIframeHeight(homepage);
        message.onclick = function () {
            homepage.src = '/index/message/';
        }

        home.onclick = function () {
            homepage.src = '/index/index/getHomepage'
        }

    };
</script>

</body>
</html>